package com.bilicute.libman.validation;

import com.bilicute.libman.annotate.Identity;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;

/**
 * @所属包名: com.bilicute.libman.validation
 * @类名: UserStatusValidation
 * @作者: i囡漫笔
 * @描述: 用户状态拦截器
 * @创建时间: 2024-06-19 08:34
 */


public class UserStatusValidation implements ConstraintValidator<Identity,String> {
    @Override
    public boolean isValid(String value, ConstraintValidatorContext context) {
        if(value == null){
            return false;
        }
        return value.equals("0") || value.equals("1");
        //提供校验规则
    }
}
